<?php

	class Mod_editar_user extends CI_Model{

		function __construct()
		{
			parent::__construct();
		}


		function editar_user($user, $pass, $nome, $mail, $morada, $nacional, $telefone, $id)
		{
			$sha1_pass = sha1($pass);
			$query_str = "UPDATE utilizador SET u_username = '".$user."', u_pass = '".$sha1_pass."', u_nome = '".$nome."', u_email = '".$mail."', u_morada = '".$morada."', u_nacionalidade = '".$nacional."', u_telefone = '".$telefone."' WHERE u_id = $id";

			$result = $this->db->query($query_str);

			if($result)
				return true;
			else
				return false;
		}

	}

?>